package org.papervision3d.core.geom
{
	import org.papervision3d.core.Matrix3D;
	
    // The Vertex3D constructor lets you create 3D vertices.
    public class Vertex3D
    {
        // An Number that sets the X coordinate of a object relative to the scene coordinate system.
        public var x:Number;
    
        // An Number that sets the Y coordinate of a object relative to the scene coordinates.
        public var y:Number;
    
        // An Number that sets the Z coordinate of a object relative to the scene coordinates.
        public var z:Number;

        // An object that contains user defined properties.
        public var extra:Object;

        public var projected:Vertex2D;
    
        // Creates a new Vertex3D object whose three-dimensional values are specified by the x, y and z parameters.
        // @param x The horizontal coordinate value. The default value is zero.
        // @param y The vertical coordinate value. The default value is zero.
        // @param z The depth coordinate value. The default value is zero.
        public function Vertex3D(x:Number = 0, y:Number = 0, z:Number = 0)
        {
            this.x = x;
            this.y = y;
            this.z = z;
        }

        public static function median(a:Vertex3D, b:Vertex3D):Vertex3D
        {
            return new Vertex3D((a.x+b.x)/2, (a.y + b.y)/2, (a.z + b.z)/2);
        }
     
    }
}
